﻿package mortal.game.resource.tableConfig
{
    import Message.DB.Tables.*;
    import com.gengine.resource.*;
    import flash.utils.*;
    import mortal.game.view.common.*;

    public class ArenaRewardConfig extends Object
    {
        private var _map:Dictionary;
        private static var _instance:ArenaRewardConfig;

        public function ArenaRewardConfig(param1:ExceptionClass)
        {
            this._map = new Dictionary();
            this.init();
            return;
        }// end function

        public function init() : void
        {
            var _loc_1:* = ConfigManager.instance.getJSONByFileName("t_arena_reward.json");
            this.write(_loc_1);
            return;
        }// end function

        private function write(param1:Object) : void
        {
            var _loc_2:TArenaReward = null;
            var _loc_3:Object = null;
            for each (_loc_3 in param1)
            {
                
                _loc_2 = new TArenaReward();
                ClassTypesUtil.copyValue(_loc_2, _loc_3);
                this._map[_loc_2.id] = _loc_2;
            }
            return;
        }// end function

        public function getInfosByTypeAndLevel(param1:int, param2:int, param3:int) : Array
        {
            var _loc_5:TArenaReward = null;
            var _loc_4:Array = [];
            for each (_loc_5 in this._map)
            {
                
                if (_loc_5.type == param1 && _loc_5.arenaLevel == param2 && param3 == _loc_5.copyType)
                {
                    _loc_4.push(_loc_5);
                }
            }
            return _loc_4;
        }// end function

        public static function get instance() : ArenaRewardConfig
        {
            if (!_instance)
            {
                _instance = new ArenaRewardConfig(new ExceptionClass());
            }
            return _instance;
        }// end function

    }
}

class ExceptionClass extends Object
{

    function ExceptionClass()
    {
        return;
    }// end function

}

